home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / Graphic Elements 3 / GEMisc / GEClearWorld.c < prev    next >
Text File  |  1995-03-27  |  783b  |  38 lines

  1. /*
  2.     GEClearWorld.c
  3.     
  4.     Utility to clear a Graphic Elements world of all elements for reuse
  5.     
  6.     Copyright 1995 by Al Evans. All rights reserved.
  7.     
  8.     3/27/95
  9.     
  10. */
  11.  
  12. #include "GEClearWorld.h"
  13. #include "Rects.h"
  14. #include "GEWorldManager.h"
  15.  
  16. void ClearGEWorld(GEWorldPtr world)
  17. {
  18.     Boolean wasActive = world->active;
  19.     Boolean wasOnWorldList = world->onWorldList;
  20.     
  21.     if (wasActive)
  22.         ActivateWorld(world, false);
  23.     if (wasOnWorldList)
  24.         DeleteFromWorldList(world);
  25.     while (world->idList) 
  26.         DisposeGrafElement(world, world->idList->objectID);
  27.     ClearRectList(world->activeRectList);
  28.     ClearRectList(world->safeRectList);
  29.     ClearList(world->sensorList);
  30.     RectRgn(world->clipRgn, &world->animationRect);
  31.     if (wasOnWorldList)
  32.         AddToWorldList(world);
  33.     if (wasActive)
  34.         ActivateWorld(world, true);
  35.  
  36. }
  37.  
  38.